package DayFive;

import java.util.Scanner;

public class TestOne {

    public static boolean isHuiWen(String str){
            StringBuilder builder = new StringBuilder(str);
            builder = builder.reverse();
            return builder.equals(str)?true:false;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
        int count = 0;
        StringBuilder builder = new StringBuilder(s2);
        builder=builder.append(s1);
       Boolean flag = isHuiWen(String.valueOf(builder));
       if(flag==true){
           count++;
           flag=false;
       }
        //这里没有判断首的情形；所以最后再加一个首的判断就可以了；
        for(int i = 0;i<s1.length();i++){
            String str = s1.substring(0,i+1);
            str+=s2;
            String str1 = s1.substring(i+1,s1.length());
            str+=str1;
         flag = isHuiWen(str);
         if(flag==true){
             count++;
             flag=false;
         }
        }
        System.out.println(count);
    }
}
